//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995-1999  Microsoft Corporation

Module Name:

gprs.h

Abstract:


Notes:


--*/

#pragma once

HRESULT RILDrv_GetSystemTime                     (DWORD dwParam);
HRESULT RILDrv_GetGPRSContextList                (DWORD dwParam);
HRESULT RILDrv_SetGPRSContext                    (DWORD dwParam, const RILGPRSCONTEXT* lpGprsContext);
HRESULT RILDrv_DeleteGPRSContext                 (DWORD dwParam, DWORD dwContextID);
HRESULT RILDrv_GetRequestedQualityOfServiceList  (DWORD dwParam);
HRESULT RILDrv_SetRequestedQualityOfService      (DWORD dwParam, const RILGPRSQOSPROFILE* lpGprsQosProfile);
HRESULT RILDrv_DeleteRequestedQualityOfService   (DWORD dwParam, DWORD dwContextID);
HRESULT RILDrv_GetMinimumQualityOfServiceList    (DWORD dwParam);
HRESULT RILDrv_SetMinimumQualityOfService        (DWORD dwParam, const RILGPRSQOSPROFILE* lpGprsQosProfile);
HRESULT RILDrv_DeleteMinimumQualityOfService     (DWORD dwParam, DWORD dwContextID);
HRESULT RILDrv_SetGPRSAttached                   (DWORD dwParam, BOOL fAttached);
HRESULT RILDrv_GetGPRSAttached                   (DWORD dwParam);
HRESULT RILDrv_SetGPRSContextActivated           (DWORD dwParam, DWORD dwContextID, BOOL fContextActivation);
HRESULT RILDrv_GetGPRSContextActivatedList       (DWORD dwParam);
HRESULT RILDrv_EnterGPRSDataMode                 (DWORD dwParam, const RILENTERGPRSDATAMODE * lpEnterGprsDataMode);
HRESULT RILDrv_GetGPRSAddress                    (DWORD dwParam, DWORD dwContextID);
HRESULT RILDrv_SetGPRSAutoAnswer                 (DWORD dwParam, BOOL fAutoAnswer);
HRESULT RILDrv_GetGPRSAttachState                (DWORD dwParam);
HRESULT RILDrv_GPRSAnswer                        (DWORD dwParam, const RILGPRSANSWER *lpGprsAnswer);
HRESULT RILDrv_GetGPRSRegistrationStatus         (DWORD dwParam);
HRESULT RILDrv_GetGPRSClass                      (DWORD dwParam);
HRESULT RILDrv_SetGPRSClass                      (DWORD dwParam, DWORD dwClass);
HRESULT RILDrv_GetMOSMSService                   (DWORD dwParam);
HRESULT RILDrv_SetMOSMSService                   (DWORD dwParam, DWORD dwMoSmsService);
HRESULT RILDrv_NdisSetGPRSContextActivated       (DWORD dwParam, const RILNDISGPRSCONTEXT *lpNdisSetGprsContextActivated );
HRESULT RILDrv_NdisReceivePacketDone             (DWORD dwParam, RILNDISPACKET* lpNdisPacket);
HRESULT RILDrv_NdisSendPacket                    (DWORD dwParam, RILNDISPACKET* lpNdisPacket);

HRESULT ParseGetGprsCapsClass(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
HRESULT ParseGetGprsCapsContext(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
HRESULT ParseGetGprsCapsQOS(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
HRESULT ParseGetGprsCapsQOSMin(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
HRESULT ParseGetGprsCapsSMOSMS(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
HRESULT ParseGetGPRSRegistrationStatus(LPCSTR szRsp, void*& pBlob, UINT& cbBlob);
#ifdef EMP_DRIVER
// For EMP Multiple PDP contexts support
// The maximum number of PDP contexts supported by CAIF driver is 3
const BYTE MaxChannelId = 3;
const DWORD InvalidContextId = 0xFFFFFFFF;

// A singleton class to get serial port name and handle by context id
class CCidSerialPortHandleMap
{
private:
    DWORD m_ContextID[MaxChannelId];
    HANDLE m_SerialPortHandle[MaxChannelId];
    TCHAR m_SerialPortName[MaxChannelId][10];

protected:
    CCidSerialPortHandleMap();

public:
    static CCidSerialPortHandleMap* Instance();
    HRESULT GetSerialPortNameFromContextID(DWORD dwContextID, TCHAR *tszDataPortName, DWORD dwSize, DWORD *pdwSizeOut);
    HRESULT GetSerialPortHandleFromContextID(DWORD dwContextID, HANDLE *lphSerial);
};
#endif
